package com.zhentao.config;

import org.springframework.web.servlet.support.AbstractAnnotationConfigDispatcherServletInitializer;

public class ApplicationInitializer extends AbstractAnnotationConfigDispatcherServletInitializer {


    @Override
    protected Class<?>[] getRootConfigClasses() {
        Class[] classes = new Class[]{SpringConfig.class};
        return classes;
    }

    @Override
    protected Class<?>[] getServletConfigClasses() {
        //前端控制器加载
        //加载Springmvc控制类
        Class[] classes = new Class[]{SpringmvcConfig.class};
        return classes;
    }

    @Override
    protected String[] getServletMappings() {
        //前端控制器中拦截所有请求 /代表项目的根
        String [] s=new String []{"/"};
        return s;
    }
}
